#ifndef ANIMATIONDATA_H
#define ANIMATIONDATA_H

#include <vector>
#include "Data.h"
#include "../core/Timer.h"
#include "../utilities/AnimationSet.h"
#include "../utilities/SpriteSheet.h"

namespace binge
{

class AnimationData : public Data
{
public:
    AnimationData(void);
    ~AnimationData(void);

    virtual void AddObject(int id);
    virtual void RemoveObject(int id);

    void SetName(int id, std::string name);
    std::string GetName(int id);

    void SetCurrentFrame(int id, int num); // is the index of the current animation set
    int GetCurrentFrame(int id); // is the actual frame number of the current animation set

    Timer timer;

    void AddAnimSet(int id, AnimationSet animSet);
    std::vector<AnimationSet> GetAnimSetList(int id);

    bool NextFrame(int id);

    void SetSheet(int id, SpriteSheet sheet);
    SpriteSheet& GetSheet(int id);

    void Animate(void);

private:
    std::vector<std::string> objectsName;

    std::vector< std::vector<AnimationSet> > objectsAnimSetList;
    std::vector<SpriteSheet> objectsSheet;

    std::vector<int> objectsAnimSetIndex;
    std::vector<unsigned int> objectsFrameStart;
};

} // namespace

#endif // ANIMATIONDATA_H
